<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 
<html xmlns="http://www.w3.org/1999/xhtml"> 
<head> 
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> 
<title>aa</title> 
   
   <script src="../jquery-1.11.3.min.js" type="text/javascript" charset="utf-8"></script>
<script>
function playSound(){     //IE放 背景音乐
    var snd_ie = document.getElementById('snd_ie');  
    snd_ie.src = "./alert.wav" 
   
    //chrome
    var snd_chrome = document.getElementById('snd_chrome');
    snd_chrome.src = './alert.ogg'
    snd_chrome.play();
    // snd_chrome.data = "./alert.ogg" 
}  
function stopSound(){  
    var snd_ie = document.getElementById('snd_ie');  
    snd_ie.src = "" 
   
   
    var snd_chrome = document.getElementById('snd_chrome');
    // snd_chrome.data = './alert.ogg';
    snd_chrome.src = ''
    snd_chrome.pause();
}  
   
   
</script>  
   
   
</head> 
<body> 
    <bgsound id='snd_ie' src="./alert.wav" loop=-1></bgsound> 
    <!--<object id='snd_chrome' width="0px" height="0px" type="audio/x-wav" data=""></object>--> 
    <audio  id='snd_chrome' loop>
    	<source src="./alert.ogg" type="audio/ogg">
  		<source src="./alert.wav" type="audio/mpeg">
  		<source src="./alert.mp3" type="audio/mp3">
    </audio >
    <audio src="alert.wav">
		您的浏览器不支持 audio 标签。
	</audio>

    <input type="button" value="开始" onclick="playSound();" />  
    <input type="button" value="暂停" onclick="stopSound();" />  
</body> 
</html> 